package com.googlecode.jsitemap;

/**
 * @author Denis Migol
 * 
 */
public abstract class XMLBuilderBase<E extends XMLEntryBase<?>, P extends XMLBuildParamsBase<?>> extends
		BuilderBase<E, P> implements XMLBuilder<E, P> {

	public XMLBuilderBase(final P params) {
		super(params);
	}

	protected byte[] beginElement(final String name) {
		return getBytes("<" + name + ">");
	}

	protected byte[] endElement(final String name) {
		return getBytes("</" + name + ">");
	}

	protected byte[] element(final String name, final String value) {
		return getBytes("<" + name + ">" + value + "</" + name + ">");
	}

	protected byte[] xmlHeader() {
		return getBytes(XML_HEADER);
	}
}
